package com.qfedu.microcoupon.template.task;

import com.qfedu.microcoupon.template.service.CouponTemplateService;
import com.xxl.job.core.handler.annotation.XxlJob;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Classname XxlJobTask
 * @Description TODO
 * @Date 2025-10-10 10:55
 * @Created by 老任与码
 */
@Component
public class XxlJobTask {

    @Resource
    private CouponTemplateService couponTemplateService;

    // 修饰定时任务执行的方法，需要设置名称
    @XxlJob("printInfoHandler")
    public void printInfo() {
        System.out.println("hello");
    }

    @XxlJob("updateTemplateHandler")
    public void updateTemplateExpireStatus() {
        couponTemplateService.updateExpireStatusTask();
    }
}
